from django.urls import path
from apps.DTA.views import rfm_analysis
from apps.DTA.views import customer_lifecycle
from apps.DTA.views import sales_prediction

urlpatterns = [
    # RFM分析相关API - 只保留基础功能
    path('summary/', rfm_analysis.get_rfm_summary, name='rfm_summary'),
    path('matrix/', rfm_analysis.get_rfm_matrix, name='rfm_matrix'),
    path('customer-types/', rfm_analysis.get_customer_types, name='customer_types'),
    path('analysis-results/', rfm_analysis.get_rfm_analysis_results, name='rfm_analysis_results'),
    
    # 新增的增强图表功能API
    path('trends/', rfm_analysis.get_rfm_trends, name='rfm_trends'),
    path('lifecycle/', rfm_analysis.get_customer_lifecycle, name='customer_lifecycle'),
    path('monetary-distribution/', rfm_analysis.get_monetary_distribution, name='monetary_distribution'),
    
    # 客户生命周期分析API
    path('lifecycle-summary/', customer_lifecycle.get_lifecycle_summary, name='lifecycle_summary'),
    path('lifecycle-stats/', customer_lifecycle.get_lifecycle_stats, name='lifecycle_stats'),
    path('lifecycle-details/', customer_lifecycle.get_lifecycle_details, name='lifecycle_details'),
    
    # 销售预测分析API
    path('sales/predict/', sales_prediction.predict_sales, name='predict_sales'),
    path('sales/historical/', sales_prediction.get_historical_sales, name='get_historical_sales'),
    path('sales/seasonality/', sales_prediction.get_sales_seasonality, name='get_sales_seasonality'),
    path('sales/product-comparison/', sales_prediction.get_product_sales_comparison, name='get_product_sales_comparison'),
    path('sales/error-analysis/', sales_prediction.get_prediction_error_analysis, name='get_prediction_error_analysis'),
]
